package com.beichuan_travel.model.abstracts;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/*
 * 景点
 * */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Attraction {

    /*
     * 景点名字
     * */
    @ApiModelProperty(value = "景点名字", allowEmptyValue = false)
    @NotBlank(message = "景点名字不能为空")
    @Length(max = 30, message = "景点名字不能超过30字")
    private String name;

    /*
     * 景点位置
     * */
    @ApiModelProperty(value = "景点地址", allowEmptyValue = false)
    @NotBlank(message = "景点地址不能为空")
    @Length(max = 100,message = "景区地址不能超过100字")
    private String location;

    /*
     * 景点星级
     * */
    @ApiModelProperty(value = "景点星级，1~5星，浮点数类型", allowEmptyValue = false)
    @Digits(integer = 1, fraction = 5, message = "星级只能在1~5之间")
    private Float star;

    /*
     * 景点门票价格
     * */
    @ApiModelProperty(value = "景点价格，浮点数类型", allowEmptyValue = false)
    private Float price;

    /*
     * 景点描述
     * */
    @ApiModelProperty(value = "景点描述", allowEmptyValue = true)
    @Length(max = 100, message = "超过最大长度")
    private String description;
}
